#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
import pygtk
pygtk.require('2.0')
 
import gtk
 
 
class Application():
 
    def __init__(self):
        self.window = gtk.Window()
        self.window.set_title("Gado Scanning")
 
        self.create_widgets()
        self.connect_signals()
 
        self.window.show_all()
        gtk.main()
 
 
    def create_widgets(self):
        #Top level box
        self.mainBox = gtk.VBox(spacing=10)
        
        #Second Level boxes
        self.topButtons = gtk.HBox(spacing=10)
        self.middleContent = gtk.HBox(spacing=10)
        self.scannerBox = gtk.HBox(spacing=10)
        
        #Third level boxes
        self.folderSettingsBox = gtk.VBox(spacing=10)
        self.imageDisplay = gtk.VBox(spacing=10)
        
        #Image display box
        self.lastImageLabel = gtk.Label("Last Image Scanned, Front")
        self.lastImageLabelBack = gtk.Label("Last Image Scanned, Back")
        self.lastScanned = gtk.Image()
        self.lastScanned.set_from_file("testimage.jpg")
        self.lastScannedBack = gtk.Image()
        self.lastScannedBack.set_from_file("testimage.jpg")
        self.imageDisplay.pack_start(self.lastImageLabel)
        self.imageDisplay.pack_start(self.lastScanned)
        self.imageDisplay.pack_start(self.lastImageLabelBack)
        self.imageDisplay.pack_start(self.lastScannedBack)
        
        #Folder settings box
        self.folderSettingsDivider = gtk.VBox(spacing=10)
        #Top
        self.folderSettingsTop = gtk.VBox(spacing=10)
        self.selectFolderLabel = gtk.Label("Select Folder")
        self.folderList = gtk.TreeView()
        self.scanHereButton = gtk.Button("Scan Here")
        self.folderSettingsTop.pack_start(self.selectFolderLabel)
        self.folderSettingsTop.pack_start(self.folderList)
        self.folderSettingsTop.pack_start(self.scanHereButton)
        #Bottom
        self.folderSettingsBottom = gtk.VBox(spacing=10)
        self.addFoldersLabel = gtk.Label("Folder Quick Add")
        self.collectionList = gtk.TreeView()
        self.addFolder = gtk.Button("Add Folder")
        self.folderName = gtk.Entry()
        self.folderSettingsBottom.pack_start(self.addFoldersLabel)
        self.folderSettingsBottom.pack_start(self.collectionList)
        self.folderSettingsBottom.pack_start(self.folderName)
        self.folderSettingsBottom.pack_start(self.addFolder)      
        self.folderSettingsDivider.pack_start(self.folderSettingsTop)
        #Combine
        self.folderSettingsDivider.pack_start(self.folderSettingsBottom)
        self.folderSettingsBox.pack_start(self.folderSettingsDivider)
        
        #Pack the second level boxes
        self.middleContent.pack_start(self.folderSettingsBox)
        self.middleContent.pack_start(self.imageDisplay)
        
        #Scanner box
        self.scanButton = gtk.Button("Begin Scanning")
        self.scannerInfo = gtk.Table(3,4)
        self.scannerBox.pack_start(self.scanButton)
        self.scannerBox.pack_start(self.scannerInfo)
        
        #Put everything into main box
        self.mainBox.pack_start(self.topButtons)
        self.mainBox.pack_start(self.middleContent)
        self.mainBox.pack_start(self.scannerBox)


 
        self.window.add(self.mainBox)
 
 
    def connect_signals(self):
        pass
 
 
    def callback_ok(self, widget, callback_data=None):
        pass
 
 
    def callback_exit(self, widget, callback_data=None):
        pass
 
 
if __name__ == "__main__":
    app = Application()
